-------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:/Users/malhot51/Dropbox/Why Do People Stay Poor - replication files/re
> plication files/Results/structural/counterfactuals.log
  log type:  text
 opened on:  13 Oct 2021, 17:40:23

. 
. * Get original misallocation
. 
. import excel "$output/Structural_Results_at_ss_assets_minus_land_of_rich.xlsx", she
> et("Sheet1") firstrow clear
file C:/Users/malhot51/Dropbox/Why Do People Stay Poor - replication files/replicatio
> n files/Results/structural/Structural_Results_at_ss_assets_minus_land_of_rich.xlsx 
> not found
r(601);

end of do-file
r(601);

end of do-file
r(601);

end of do-file

r(601);

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
. *** Numbers in Subsection 4.4
. do "5.1_Counterfactuals_numbers.do"

. * In-text numbers in the Counterfactuals subsection
. * 31 Jan 2020
. 
. clear all

. set more off

. 
. log using "$output/counterfactuals.log", replace
log file already open
r(604);

end of do-file
r(604);

end of do-file

r(604);

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
. **------------------------------------------------------------------------------
. ** SETTINGS
. **------------------------------------------------------------------------------
. clear all

. set more off

. set maxvar 30000


. set matsize 3000
set matsize ignored.
    Matrix sizes are no longer limited by c(matsize) in modern Statas.  Matrix
    sizes are now limited by edition of Stata.  See limits for more details.

. mata: mata clear

. 
. 
. **------------------------------------------------------------------------------
. ** SET DIRECTORIES
. **------------------------------------------------------------------------------
. 
.         // SET FILE DIRECTORY HERE
. *global user "C:/Users/jahei/Dropbox/Why Do People Stay Poor - replication files/re
> plication files"
. *global user "C:/Users/rriis/Dropbox/Why Do People Stay Poor - replication files/re
> plication files"
. *global user "C:/Users/laszlod/Dropbox/Why Do People Stay Poor - replication files/
> replication files"
. *global user "C:/Users/rriis/Dropbox/Why Do People Stay Poor - replication files/re
> plication files"
. *global user "/Users/laszloda/Dropbox_lse/Dropbox/Why Do People Stay Poor - replica
> tion files/replication files"
. global user "C:/Users/malhot51/Dropbox/Why Do People Stay Poor - replication files/
> replication files"

. 
. cd "$user"
C:\Users\malhot51\Dropbox\Why Do People Stay Poor - replication files\replication fil
> es

. 
. 
. global Data "${user}/Data"

. global Output "${user}/Results"

. global Do "${user}/Code"

. global stest "${user}/shape test and P-spline"

. global asset_densities "${user}/Asset Densities"

. 
. 
. 
end of do-file

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
.         // NOTE: CHANGED A.H. 04/10/21
. 
. 
. clear all

. set more off

. 
. * 0. Working Directory and Paths
. 
. //if c(username) == "quintasm" cd "Z:\poverty traps\Replication files (revision)"
. //if c(username) == "Clare Balboni" cd "C:\Users\Clare Balboni\Dropbox\BRAC Poverty
> Traps\analysis\Structural analysis\Replication files (revision)"
. //if c(username) == "Psthu" cd "C:\Dropbox (MIT)\BRAC PovertyTraps\analysis\Structu
> ral analysis\Replication files (revision)"
. 
.         
. cd "${Do}/structural"
C:\Users\malhot51\Dropbox\Why Do People Stay Poor - replication files\replication fil
> es\Code\structural

. 
. global path : pwd

. global input "${Data}/structural/input"

. global intermediate "${Data}/structural/intermediate"

. global output_s "${Data}/structural/output"

. global output "${Output}/structural"

. 
. 
end of do-file

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
. *** Numbers in Subsection 4.4
. do "5.1_Counterfactuals_numbers.do"

. * In-text numbers in the Counterfactuals subsection
. * 31 Jan 2020
. 
. clear all

. set more off

. 
. log using "$output/counterfactuals.log", replace
log file already open
r(604);

end of do-file
r(604);

end of do-file

r(604);

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
. *** Numbers in Subsection 4.4
. do "5.1_Counterfactuals_numbers.do"

. * In-text numbers in the Counterfactuals subsection
. * 31 Jan 2020
. 
. clear all

. set more off

. 
. log using "$output_s/counterfactuals.log", replace //edited_RM
log file already open
r(604);

end of do-file
r(604);

end of do-file

r(604);

. do "C:\Users\malhot51\Dropbox\Why Do People Stay Poor - replication files\replicati
> on files\Code\structural\5.1_Counterfactuals_numbers.do"

. * In-text numbers in the Counterfactuals subsection
. * 31 Jan 2020
. 
. clear all

. set more off

. 
. log using "$output_s/counterfactuals.log", replace //edited_RM
log file already open
r(604);

end of do-file

r(604);

. do "C:\Users\malhot51\AppData\Local\Temp\STD278c_000000.tmp"

. 
. *** Numbers in Subsection 4.4
. do "5.1_Counterfactuals_numbers.do"

. * In-text numbers in the Counterfactuals subsection
. * 31 Jan 2020
. 
. clear all

. set more off

. 
. *log using "$output_s/counterfactuals.log", replace //edited_RM //commented_RM
. 
. * Get original misallocation
. 
. import excel "$output_s/Structural_Results_at_ss_assets_minus_land_of_rich.xlsx", s
> heet("Sheet1") firstrow clear //edited_RM
(5 vars, 2,333 obs)

. 
. quietly: su misallocation, d

. local misallocation_orig = r(sum)

. 
. * Reducing A by 50%
. 
. import delimited "$intermediate\counterfactuals\optimal_case_by_hh3_with_A_reduced_
> at_ss_assets_minus_land_of_rich.csv", clear
(encoding automatically selected: ISO-8859-1)
(3 vars, 2,333 obs)

. 
. gen occup = ceil(case_opt/2) //Quick way to separate cases

. 
. label define occupation 1 "Mixing" 2 "Livestock Rearing Only" 3 "Wage Work Only" 4 
> "No Work"

. label values occup occupation

. 
. tab occup

                 occup |      Freq.     Percent        Cum.
-----------------------+-----------------------------------
                Mixing |        538       23.06       23.06
Livestock Rearing Only |      1,612       69.10       92.16
        Wage Work Only |        183        7.84      100.00
-----------------------+-----------------------------------
                 Total |      2,333      100.00

. 
. quietly: su misallocation_sim, d

. disp 1 - r(sum)/`misallocation_orig'
.57008374

. 
. * Doubling w
. 
. import delimited "$intermediate\counterfactuals\optimal_case_by_hh3_with_w_doubled_
> at_ss_assets_minus_land_of_rich.csv", clear
(encoding automatically selected: ISO-8859-1)
(3 vars, 2,333 obs)

. 
. gen occup = ceil(case_opt/2) //Quick way to separate cases

. 
. label define occupation 1 "Mixing" 2 "Livestock Rearing Only" 3 "Wage Work Only" 4 
> "No Work"

. label values occup occupation

. 
. tab occup

                 occup |      Freq.     Percent        Cum.
-----------------------+-----------------------------------
                Mixing |        879       37.68       37.68
Livestock Rearing Only |      1,352       57.95       95.63
        Wage Work Only |        102        4.37      100.00
-----------------------+-----------------------------------
                 Total |      2,333      100.00

. 
. quietly: su misallocation_sim, d

. disp 1 - r(sum)/`misallocation_orig'
.07289002

. 
. * Reducing psi_h by 50%
. 
. import delimited "$intermediate\counterfactuals\optimal_case_by_hh3_psih_reduced_at
> _ss_assets_minus_land_of_rich.csv", clear
(encoding automatically selected: ISO-8859-1)
(3 vars, 2,333 obs)

. 
. gen occup = ceil(case_opt/2) //Quick way to separate cases

. 
. label define occupation 1 "Mixing" 2 "Livestock Rearing Only" 3 "Wage Work Only" 4 
> "No Work"

. label values occup occupation

. 
. tab occup

                 occup |      Freq.     Percent        Cum.
-----------------------+-----------------------------------
                Mixing |        405       17.36       17.36
Livestock Rearing Only |      1,819       77.97       95.33
        Wage Work Only |        109        4.67      100.00
-----------------------+-----------------------------------
                 Total |      2,333      100.00

. 
. quietly: su misallocation, d

. disp 1 - r(sum)/`misallocation_orig'
.01114153

. 
. log close
      name:  <unnamed>
       log:  C:/Users/malhot51/Dropbox/Why Do People Stay Poor - replication files/re
> plication files/Results/structural/counterfactuals.log
  log type:  text
 closed on:  13 Oct 2021, 18:04:11
-------------------------------------------------------------------------------------
